import 'package:safetymonitor/app/data/common/choice_bean.dart';
import 'package:safetymonitor/generated/json/base/json_field.dart';
import 'package:safetymonitor/generated/json/env_company_tree_entity.g.dart';
import 'dart:convert';
export 'package:safetymonitor/generated/json/env_company_tree_entity.g.dart';

@JsonSerializable()
class EnvCompanyTreeEntity implements ChoiceBean {
  dynamic id;
  int? nodeId;
  String? nodeName;
  dynamic thresholdVal;
  dynamic categoryEn;
  int? nodeType;
  List<EnvCompanyTreeChildren>? children;
  dynamic systemType;
  int? companyType;
  dynamic sort;
  dynamic queryParams;
  /// 是否选中
  bool isChecked = false;
  EnvCompanyTreeEntity();

  factory EnvCompanyTreeEntity.fromJson(Map<String, dynamic> json) => $EnvCompanyTreeEntityFromJson(json);

  Map<String, dynamic> toJson() => $EnvCompanyTreeEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return nodeId.toString();
  }

  @override
  String getShowName() {
    return nodeName!;
  }

  @override
  bool getIsChecked() {
    return isChecked;
  }

  @override
  setIsChecked(bool isChecked) {
    this.isChecked = isChecked;
  }
}

@JsonSerializable()
class EnvCompanyTreeChildren  implements ChoiceBean {
  dynamic id;
  int? nodeId;
  String? nodeName;
  dynamic thresholdVal;
  dynamic categoryEn;
  int? nodeType;
  List<EnvCompanyTreeChildrenChildren>? children;
  int? systemType;
  dynamic companyType;
  dynamic sort;
  dynamic queryParams;
  /// 是否选中
  bool isChecked = false;
  EnvCompanyTreeChildren();

  factory EnvCompanyTreeChildren.fromJson(Map<String, dynamic> json) => $EnvCompanyTreeChildrenFromJson(json);

  Map<String, dynamic> toJson() => $EnvCompanyTreeChildrenToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return nodeId.toString();
  }

  @override
  String getShowName() {
    return nodeName!;
  }

  @override
  bool getIsChecked() {
    return isChecked;
  }

  @override
  setIsChecked(bool isChecked) {
    this.isChecked = isChecked;
  }
}

@JsonSerializable()
class EnvCompanyTreeChildrenChildren  implements ChoiceBean {
  dynamic id;
  int? nodeId;
  String? nodeName;
  dynamic thresholdVal;
  dynamic categoryEn;
  int? nodeType;
  List<EnvCompanyTreeChildrenChildrenChildren>? children;
  dynamic systemType;
  dynamic companyType;
  dynamic sort;
  dynamic queryParams;
  /// 是否选中
  bool isChecked = false;
  EnvCompanyTreeChildrenChildren();

  factory EnvCompanyTreeChildrenChildren.fromJson(Map<String, dynamic> json) => $EnvCompanyTreeChildrenChildrenFromJson(json);

  Map<String, dynamic> toJson() => $EnvCompanyTreeChildrenChildrenToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return nodeId.toString();
  }

  @override
  String getShowName() {
    return nodeName!;
  }

  @override
  bool getIsChecked() {
    return isChecked;
  }

  @override
  setIsChecked(bool isChecked) {
    this.isChecked = isChecked;
  }
}

@JsonSerializable()
class EnvCompanyTreeChildrenChildrenChildren  implements ChoiceBean {
  dynamic id;
  int? nodeId;
  String? nodeName;
  dynamic thresholdVal;
  dynamic categoryEn;
  int? nodeType;
  dynamic children;
  dynamic systemType;
  dynamic companyType;
  dynamic sort;
  EnvCompanyTreeChildrenChildrenChildrenQueryParams? queryParams;
  /// 是否选中
  bool isChecked = false;
  EnvCompanyTreeChildrenChildrenChildren();

  factory EnvCompanyTreeChildrenChildrenChildren.fromJson(Map<String, dynamic> json) => $EnvCompanyTreeChildrenChildrenChildrenFromJson(json);

  Map<String, dynamic> toJson() => $EnvCompanyTreeChildrenChildrenChildrenToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
  @override
  String getId() {
    return nodeId.toString();
  }

  @override
  String getShowName() {
    return nodeName!;
  }

  @override
  bool getIsChecked() {
    return isChecked;
  }

  @override
  setIsChecked(bool isChecked) {
    this.isChecked = isChecked;
  }
}

@JsonSerializable()
class EnvCompanyTreeChildrenChildrenChildrenQueryParams {
  int? companyId;
  int? systemId;
  String? systemCode;
  String? deviceCode;
  String? queryStartTime;
  String? queryEndTime;

  EnvCompanyTreeChildrenChildrenChildrenQueryParams();

  factory EnvCompanyTreeChildrenChildrenChildrenQueryParams.fromJson(Map<String, dynamic> json) => $EnvCompanyTreeChildrenChildrenChildrenQueryParamsFromJson(json);

  Map<String, dynamic> toJson() => $EnvCompanyTreeChildrenChildrenChildrenQueryParamsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
